﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PVFSLEAP
{
	class C_COMM
	{
		private object	DG;

		int NDCT;

		public const int FLSE = 0;
		public const int TRUE = 1;

		public const int TTND = 101;

		public const int CLST = 99;
		public const int WDTH = 1000;
		public const int HGHT = 1000;

		public const int INIT = 0;	// Initial
		public const int SCND = 1;	// Search Node
		public const int CNMD = 2;	// Compromised Node
		public const int WORM = 3;	// Wormhole Node
		public const int NPRT = 4;	// No Parent Node
		public const int EVNT = 5;	// Choose Evnet

		public C_COMM()
		{
		}

		public void SetNDCT( int C )
		{
			NDCT = C;
		}

		public void SetGrid( object sdg )
		{
			this.DG = sdg;
		}

		public void AlignCell( string CL, string F )
		{
			if ( F == "R" )
				( ( DataGridView )DG ).Columns[CL].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
			else if ( F == "C" )
				( ( DataGridView )DG ).Columns[CL].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
		}

		public double consumeGeneratingVote( double E, int S )
		{
			return E + 15f * S;
		}

		public double consumeTransmitting( double E, int S )
		{
			return E + 16.56f * S;
		}

		public double consumeReceiving( double E, int S )
		{
			return E + 12.5f * S;
		}
	}
}
